//
//  LRNaviController.swift
//  LRWeibo
//
//  Created by Ruihaha on 16/9/22.
//  Copyright © 2016年 macbook air . All rights reserved.
//

import UIKit

class LRNaviController: UINavigationController {

    override func viewDidLoad() {
        super.viewDidLoad()

    }

    override func pushViewController(_ viewController: UIViewController, animated: Bool) {
        
        if self.childViewControllers.count>0{
            
            viewController.hidesBottomBarWhenPushed=true
            let leftBtnItem = UIBarButtonItem(title: "返回", imageName: "navigationbar_back_withtext", target: self, action: #selector(back))
            viewController.navigationItem.leftBarButtonItem = leftBtnItem
                
            }
        super.pushViewController(viewController, animated: animated)
    }

    @objc private func back(){
        popViewController(animated: true)
    }

    
}
